<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use app\common\library\Token;
use think\Request;
use app\common\model\User;
class Index extends Frontend
{

    protected $noNeedLogin = [];
    protected $noNeedRight = '*';
    protected $layout = 'layout';

    public function _initialize()
    {
      
        parent::_initialize();
    }

    public function index()
    {   
        
        return $this->view->fetch();
    }

    public function news()
    {
        $newslist = [];
        return jsonp(['newslist' => $newslist, 'new' => count($newslist), 'url' => 'https://www.fastadmin.net?ref=news']);
    }
    public function upload(){
         $token = $this->auth->getUserToken();
         $user = User::get($token['user_id']);
       
        return $this->view->fetch('',['user'=>$user]);
    }
    public function notice(){
    $informlist = \app\common\model\Inform::page(input('page'))->order('id desc')->paginate(10);

    return $this->view->fetch('',['list'=>$informlist]);
    }
    public function notice_details(){
     $id=$_GET['id'];
     $inform = \app\common\model\Inform::get($id);

    return $this->view->fetch('',['info'=>$inform]);    
    }

}
